package hello.repositorycontroller;

import hello.dao.PersonRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.rest.webmvc.RepositoryRestController;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Author: m01
 * @Date: created at  2018/12/21  16:13
 * @Modified By:
 */
@RepositoryRestController
public class ScannerController {


    @Autowired
    private PersonRepository personRepository;

    @RequestMapping(method = RequestMethod.GET, value = "/person/search/getPersonAndAddress")
    @ResponseBody
    public Map<String, String> test(@RequestParam(value = "id") Long id) {
        System.out.println(" id  " + id);
        List<Object[]> list=personRepository.getPersonAndAddress(id);
        return new HashMap<>();
    }
}
